<!DOCTYPE html>
<html>
	<head> 
		<meta charset="utf-8" />
		<title>Swiper示例</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
		<link rel="stylesheet" href="css/swiper.min.css" />
		<link rel="stylesheet" href="css/animate.min.css" />
		<link rel="stylesheet" href="css/index.css" />
	</head>
	<body>
		<div class="swiper-container">
			<div class="swiper-wrapper">
		        <div class="swiper-slide" data-hash="slide1">
		        	<div class="page">
		        		Slide 11111
		        		<p class="ani" swiper-animate-effect="fadeInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.3s">上面淡入</p>
		        		<p class="ani" swiper-animate-effect="bounceInLeft" swiper-animate-duration="0.5s" swiper-animate-delay="0.3s">左边进入</p>
		        		<p class="ani" swiper-animate-effect="bounceInRight" swiper-animate-duration="0.5s" swiper-animate-delay="0.3s">右边进入</p>
		        		<p class="ani" swiper-animate-effect="bounceInUp" swiper-animate-duration="0.5s" swiper-animate-delay="0.3s">上面进入</p>
		        		<p class="ani" swiper-animate-effect="bounceInDown" swiper-animate-duration="0.5s" swiper-animate-delay="0.3s">下面进入</p>
		        	</div>
		        </div>
		        <div class="swiper-slide" data-hash="slide2">
		        	<div class="page">
		        		Slide 22222
		        		<p class="ani" swiper-animate-effect="flash" swiper-animate-duration="0.5s" swiper-animate-delay="0.3s">闪动</p>
		        		<p class="ani" swiper-animate-effect="shake" swiper-animate-duration="0.5s" swiper-animate-delay="0.3s">摇动</p>
		        		<p class="ani" swiper-animate-effect="flip" swiper-animate-duration="0.5s" swiper-animate-delay="0.3s">翻转</p>
		        	</div>
		        </div>
		        
		        <div class="swiper-slide" data-hash="slide3">
		        	<div class="page">
			            <img data-src="img/picture-1.jpg" class="swiper-lazy">
			            <div class="swiper-lazy-preloader"></div>
		            </div>
		        </div>
		        <div class="swiper-slide" data-hash="slide4">
		        	<div class="page">
			            <img data-src="img/picture-2.jpg" class="swiper-lazy">
			            <div class="swiper-lazy-preloader swiper-lazy-preloader-white"></div>
			        </div>
		        </div>
		        <div class="swiper-slide" data-hash="slide5">
		        	<div class="page">
			            <img data-src="img/picture-3.jpg" class="swiper-lazy">
			        </div>
		        </div>
		        
		    </div>
		    
		    <!-- 分页器 -->
		    <div class="swiper-pagination"></div>
		    
		    <!-- 导航按钮 -->
		    <div class="up"><div class="ups"></div></div>
		    
		</div>
		<script type="text/javascript" src="js/zepto.min.js" ></script>
		<script type="text/javascript" src="js/swiper.jquery.min.js" ></script>
		<script type="text/javascript" src="js/swiper.animate1.0.2.min.js" ></script>
		<script>
			$(function(){
				var mySwiper = new Swiper('.swiper-container', {
		        	direction: 'vertical',
		        	loop: true,  //循环模式
		        	autoHeight: true, //高度随内容变化
		        	effect: 'fade',  //切换效果，默认为"slide"（位移切换），可设置为"fade"（淡入）"cube"（方块）"coverflow"（3d流）"flip"（3d翻转）
		        	
		        	//url的瞄点
					hashnav:true,
					hashnavWatchState:true,
					
		        	pagination: '.swiper-pagination', //分页器
		        	paginationType: 'bullets',  //分页器样式，默认'bullets'圆点，可选'fraction'分式 、'progress'进度条、'custom'自定义
		        	paginationClickable: true,  //分页器是否可点击
		        	nextButton: '.up', //导航按钮
		        	
		        	//辅助，无障碍阅读
		        	a11y: true,
					prevSlideMessage: '上一页',
					nextSlideMessage: '下一页',
					firstSlideMessage: '这是第一页',
					lastSlideMessage: '这是最后一页',
			        paginationBulletMessage:'前往 {{index}}',
			        
		        	//动画
		        	onInit: function(swiper){ //Swiper2.x的初始化是onFirstInit
						swiperAnimateCache(swiper); //隐藏动画元素 
					    swiperAnimate(swiper); //初始化完成开始动画
					}, 
					onSlideChangeEnd: function(swiper){ 
					    swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画
					},
					
					lazyLoading : true,  //延迟加载图片
					lazyLoadingInPrevNext : true,  //设置为true允许将延迟加载应用到最接近的slide的图片（前一个和后一个slide）
					
		        });
		        
			});
		</script>
	</body>
</html>
